<script type="text/javascript" language="javascript">
    function setTab(name,cursel,n){
        for(i=1;i<=n;i++){
        var menu=document.getElementById(name+i);
        var con=document.getElementById("con_"+name+"_"+i);
        menu.className=i==cursel?"hover":"";
        con.style.display=i==cursel?"block":"none";
        }
    }
</script>
<style type="text/css">
div ul li{
padding:0;
text-align:center;
}

ul{ list-style:none;}
/*选项卡1*/
#Tab1{
width:100%;
margin:0px;
padding:0px;
margin:0 auto;}
/*选项卡2*/
#Tab2{
width:100%;
margin:0px;
padding:0px;
margin:0 auto;}
/*菜单class*/
.Menubox {
width:100%;
background:url(/admins/images/bg2.gif);
height:42px;
line-height:42px;
}
.Menubox ul{
margin:0px;
padding:0px;
}
.Menubox li{
float:left;
display:block;
cursor:pointer;
width:172px;
text-align:center;
color:#949694;
font-weight:bold;
}
.Menubox li.hover{
padding:0px;
background:#fff;
width:174px;
border-left:1px solid #A8C29F;
border-top:1px solid #A8C29F;
border-right:1px solid #A8C29F;
background:url(/admins/images/bg1.gif);
color:#739242;
font-weight:bold;
height:42px;
line-height:42px;
}
.Contentbox{
clear:both;
margin-top:0px;
border:1px solid #A8C29F;
border-top:none;
height:480px;
text-align:center;
padding-top:8px;
}
</style>
<?php
if($this->ma == 2){
    echo '<script language="javascript" type="text/javascript">alert("出现未知错误，请重新操作！");</script>';
}else if($this->ma == 3){
    echo '<script language="javascript" type="text/javascript">alert("会员充值成功！");</script>';
}else if($this->ma == 4){
    echo '<script language="javascript" type="text/javascript">alert("会员扣款成功！");</script>';
}
?>
<div style="width:100%;height:22px;"></div>
<font size="4">用户信息: </font>
<hr/>

<div style="width:880px;float:left;">
<table border="1px" cellpadding="0" cellspacing="0" width="880px" bgcolor="#FFFFFF" style="margin-top:12px;border-color: #DDDDDD;float:left;">
    <tr height="36px;"><td align="right" bgcolor="#BFBFBF">用户名：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->realname;?></td>
        <td align="right" bgcolor="#BFBFBF" width="122px;">呢称：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->nikename;?></td></tr>
    <tr height="36px;"><td align="right" bgcolor="#E5E5E5">Email：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->email;?></td>
        <td align="right" bgcolor="#E5E5E5">仓库号：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->storeno;?></td></tr>
    <tr height="36px;"><td align="right" bgcolor="#BFBFBF">金额：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->byscore->money;?></td>
        <td align="right" bgcolor="#BFBFBF">成长值：</td><td>&nbsp;&nbsp;<?php echo $this->userdetail->byscore->score;?></td></tr>
    <?php if($this->operator == Application_Model_FinancialCheckItem::Operator_Default || $this->operator == "张晨"  || $this->operator == "谭瑜"  || $this->operator == '出纳员'){ ?>
    <tr height="48px;"><td align="right" bgcolor="#E5E5E5">操作：</td>
        <td colspan="3">
            <button id="recharge_button" name="recharge_button" style="background-color: #FF8312;width: 72px;height: 36px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;margin-left: 88px;">充值</button>
            <button style="background-color: #FF8312;width: 72px;height: 36px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;margin-left: 88px;" id="deduct_button" name="deduct_button">扣款</button>
        </td></tr>
    <?php } ?>
</table>
</div>   

<div style="width:1035px;float:left;margin-top:10px;">
<div id="Tab1">
<div class="Menubox">
<ul>
<li id="one1" onclick="setTab('one',1,5)"  class="hover">运单详情</li>
<li id="one2" onclick="setTab('one',2,5)">代购详情</li>
<li id="one3" onclick="setTab('one',3,5)">仓库详情</li>
<li id="one4" onclick="setTab('one',4,5)">金额详情</li>
<li id="one5" onclick="setTab('one',5,5)">添加备注</li>
</ul>
</div>
<div class="Contentbox">
<div id="con_one_1" class="hover" style="background-color:#FFFFFF;">
   <iframe src="/admini/manageuser/billdetail/id/<?php echo $this->id;?>" width="1030px" frameborder="no" border="0" framespacing="0" scrolling="no" noresize="noresize" height="480px"></iframe>
</div>
<div id="con_one_2" style="display:none;background-color:#FFFFFF;">
   <iframe src="/admini/manageuser/buydetail/id/<?php echo $this->id;?>" width="1030px;" border="0" framespacing="0" name="iframepage" frameBorder="0" noresize="noresize" height="480px"></iframe>
</div>
<div id="con_one_3" style="display:none;background-color:#FFFFFF;">
    <iframe src="/admini/manageuser/storedetail/id/<?php echo $this->id;?>" width="1030px" frameborder="no" border="0" framespacing="0" scrolling="no" noresize="noresize" height="480px"></iframe>
</div>
<div id="con_one_4" style="display:none;background-color:#FFFFFF;">
    <iframe src="/admini/manageuser/moneydetail/id/<?php echo $this->id;?>" width="1030px" frameborder="no" border="0" framespacing="0" scrolling="no" noresize="noresize" height="480px"></iframe>
</div>
<div id="con_one_5" style="display:none;background-color:#FFFFFF;">
  <form method="post" >
    <table border="1px" cellpadding="0" cellspacing="0" width="84%" bgcolor="#FFFFFF" style="margin-top:48px;border-color: #DDDDDD;float:left;margin-left: 7%;">
    <tr height="38px;"><td colspan="2" align="center"><b><font size="4">添加备注</font></b></td></tr>
    <tr><td width="12%" align="right">备注：</td><td><textarea cols="76" rows="10" name="remark" style="margin:8px 8px 8px;"><?php echo $this->userdetail->remark;?></textarea></td></tr>
    <tr height="48px;">
        <td colspan="2">
            <input type="hidden" id="operate" name="operate" value="addremark" /><input type="hidden" id="id" name="id" value="<?php echo $this->id;?>" />
            <input type="submit" name="submit" id="submit" value="添加" style="background-color: #FF8312;width: 80px;height: 36px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;"/>　&nbsp;　&nbsp;　&nbsp;　&nbsp;　
            <input type="reset" name="reset" id="reset" value="重置"  style="background-color: #1668A4;width: 80px;height: 36px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;"/>
        </td></tr>
    </table>
  </form>
</div>
</div>
</div>
</div>
    
 <div style="width:880px;margin-top:30px;float:left;margin-left: 4%;">
    <button style="background-color: #FF8312;width: 80px;height: 42px;color: white;font-size: 16px;border-radius:8px;cursor: pointer;" id="button_return">返回</button>
    <button style="background-color: #FF8312;width: 100px;height: 42px;color: white;font-size: 16px;border-radius:8px;cursor: pointer; margin-left:88px;" id="releasemg" naem="releasemg">发布消息</button>
    <button style="background-color: #FF8312;width: 100px;height: 42px;color: white;font-size: 16px;border-radius:8px;cursor: pointer; margin-left:88px;" id="rebacklog" naem="rebacklog">添加事件</button>
</div>



<div class="tanchuang" style="display:none;">
    <div class="nui-msgbox">
        <div id="recharge_div" class="nui-msgbox-hd" style="display:none;">充值</div>
        <div id="deduct_div" class="nui-msgbox-hd" style="display:none;">扣款</div>
        <a class="nui-msgbox-close" title="关闭" id="exitissue"><b></b></a>
    </div>
    <div class="neirbox">
        <form method="post" action="/admini/manageuser/userdetail/id/<?php echo $this->userdetail->id;?>" id="formissue">
	<table>
            <tr>
            	<td class="askl">金额：</td>
                <td>
                	<input class="input w400" type="text" id="money" name="money" value="" />
                </td>
            </tr>
        	<tr>
            	<td class="askl">原因：</td>
                <td>
                    <input class="input w400" type="text" id="reason" name="reason" value="" />
                </td>
            </tr>
        	<tr>
            	<td class="askl">信息提醒：</td>
                <td>
                    <ul>
                    	<li><label><input name="message" id="message" type="checkbox" value="message" />站内信提醒</label></li>
                    </ul>
                </td>
            </tr>
        </table>
        <div class="neirboxok">
            <input type="hidden" id="operate" name="operate" value="recharge" />
            <input type="hidden" id="userid" name="userid" value="<?php echo $this->userdetail->id;?>" />
            <a class="anvbotton" href="javascript:void(0)" id="subissue"><span>确认提交</span></a>
        </div>  
        </form>
    </div>
</div>
<div class="houtai_overlay" style="display:none;"></div>
<script language='javascript'>
    $("#button_return").click(function(){
       location.href = "/admini/manageuser/index/"; 
    });
    $("#releasemg").click(function(){
       location.href = "/admini/manageuser/releasemg/userId/<?php echo $this->userdetail->id;?>"; 
    });
    $("#rebacklog").click(function(){
       location.href = "/admini/manageday/rebacklog/userid/<?php echo $this->userdetail->id;?>"; 
    });
    $("#recharge_button").click(function(){
        $("div.houtai_overlay").attr("style","display:block;");
        $("div.tanchuang").attr("style","display:block;");
        $("div#deduct_div").attr("style","display:none;");
        $("div#recharge_div").attr("style","display:block;");
        $("div.neirboxok #operate").val("recharge");
    });
    $("#deduct_button").click(function(){
        $("div.houtai_overlay").attr("style","display:block;");
        $("div.tanchuang").attr("style","display:block;");
        $("div#recharge_div").attr("style","display:none;");
        $("div#deduct_div").attr("style","display:block;");
        $("div.neirboxok #operate").val("recharge");
        $("div.neirboxok #operate").val("deduct");
    });
    $("#exitissue").live("click",function(){
        $("div.houtai_overlay").attr("style","display:none;");
        $("div.tanchuang").attr("style","display:none;");
    });
    $("#subissue").click(function(){
        $("#subissue").unbind("click");
        var money = $("div.neirbox input#money").val();
        var reason = $("div.neirbox input#reason").val();
        $("div.neirbox input#money").val(money*1);
        if(money == "" || money < 0 ){
            alert("金额不能为空或者小于0！");
            return false;
        }else if(reason == ""){
            alert("原因不能为空！");
            return false;
        }else{
            $('#formissue').submit();
        }
    });
    function dyniframesize(down) { 
        var pTar = null; 
        if (document.getElementById(down)){ 
            pTar = document.getElementById(down); 
        }else{ 
            eval('pTar = ' + down + ';'); 
        } 
        if (pTar && !window.opera){ 
            pTar.style.display="block" 
            if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){ 
                pTar.height = pTar.contentDocument.getElementById('table').offsetHeight+50; 
                pTar.width = pTar.contentDocument.body.scrollWidth; 
            } else if (pTar.Document && pTar.Document.body.scrollHeight){ 
                pTar.height = pTar.Document.body.scrollHeight; 
                pTar.width = pTar.Document.body.scrollWidth; 
            }     
        } 
    } 
    $('#alldetail #bill').click(function(){
        $("#alldetail a#buyshop").attr('style','color: ;');
        $("#alldetail a#bill").attr('style','color: red;');
        $("#alldetail a#store").attr('style','color: ;');
        $("#alldetail a#money").attr('style','color: ;');
        $("#alldetail td.bill").attr('style','border-right: 1px solid #00f;border-bottom: 1px solid #fff;');
        $("#alldetail td.store").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #000;border-top: 1px solid #ff0;');
        $("#alldetail td.buyshop").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #000;border-top: 1px solid #ff0;');
        $("#alldetail td.money").attr('style','border-right: 1px solid #ff0;border-bottom: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#billcontent").attr('style', "margin-top:10px;");
        $("#buycontent").attr('style', "margin-top:10px;display: none;");
        $("#storecontent").attr('style', "margin-top:10px;display: none;");
        $("#moneycontent").attr('style', "margin-top:10px;display: none;");
    });
    $('#alldetail #buyshop').click(function(){
        $("#alldetail a#buyshop").attr('style','color: red;');
        $("#alldetail a#bill").attr('style','color: ;');
        $("#alldetail a#store").attr('style','color: ;');
        $("#alldetail a#money").attr('style','color: ;');
        $("#alldetail td.bill").attr('style','border-left: 1px solid #ff0;border-bottom: 1px solid #00f;border-right: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#alldetail td.store").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #000;border-top: 1px solid #ff0;');
        $("#alldetail td.buyshop").attr('style','border-bottom: 1px solid #fff;border-right: 1px solid #00f;');
        $("#alldetail td.money").attr('style','border-right: 1px solid #ff0;border-bottom: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#billcontent").attr('style', "margin-top:10px;display: none;");
        $("#buycontent").attr('style', "margin-top:10px;");
        $("#storecontent").attr('style', "margin-top:10px;display: none;");
        $("#moneycontent").attr('style', "margin-top:10px;display: none;");
    });
    $('#alldetail #store').click(function(){
        $("#alldetail a#buyshop").attr('style','color: ;');
        $("#alldetail a#bill").attr('style','color: ;');
        $("#alldetail a#store").attr('style','color: red;');
        $("#alldetail a#money").attr('style','color: ;');
        $("#alldetail td.bill").attr('style','border-left: 1px solid #ff0;border-right: 1px solid #000;border-top: 1px solid #ff0;border-bottom: 1px solid #00f;');
        $("#alldetail td.store").attr('style','border-bottom: 1px solid #fff;border-right: 1px solid #00f');
        $("#alldetail td.buyshop").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#alldetail td.money").attr('style','border-right: 1px solid #ff0;border-bottom: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#billcontent").attr('style', "margin-top:10px;display: none;");
        $("#buycontent").attr('style', "margin-top:10px;display: none;");
        $("#storecontent").attr('style', "margin-top:10px;");
        $("#moneycontent").attr('style', "margin-top:10px;display: none;");
    });
    $('#alldetail #money').click(function(){
        $("#alldetail a#buyshop").attr('style','color: ;');
        $("#alldetail a#bill").attr('style','color: ;');
        $("#alldetail a#store").attr('style','color: ;');
        $("#alldetail a#money").attr('style','color: red;');
        $("#alldetail td.bill").attr('style','border-left: 1px solid #ff0;border-right: 1px solid #000;border-top: 1px solid #ff0;border-bottom: 1px solid #00f;');
        $("#alldetail td.store").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #00f;border-top: 1px solid #ff0;');
        $("#alldetail td.buyshop").attr('style','border-bottom: 1px solid #00f;border-right: 1px solid #000;border-top: 1px solid #ff0;');
        $("#alldetail td.money").attr('style','border-bottom: 1px solid #fff;');
        $("#billcontent").attr('style', "margin-top:10px;display: none;");
        $("#buycontent").attr('style', "margin-top:10px;display: none;");
        $("#storecontent").attr('style', "margin-top:10px;display: none;");
        $("#moneycontent").attr('style', "margin-top:10px;");
    });
</script>


